package com.mkz.job.feign.fallback;

import org.springframework.stereotype.Component;

import com.mkz.core.common.constant.CommonConstants;
import com.mkz.core.common.util.ResponseResult;
import com.mkz.job.entity.JobInfoVo;
import com.mkz.job.entity.XxlJobInfo;
import com.mkz.job.feign.JobinfoClient;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * ClassName: JobinfoServiceFallback 
 * @Description: 动态创建/删除任务
 * @author: KuangJianyu
 * @date: 2020年4月17日
 */
@Slf4j
@Component
public class JobinfoServiceFallback implements JobinfoClient {
	@Setter
	private Throwable cause;

	@Override
	public ResponseResult getById(Integer id) {
		log.error("查询定时任务失败，"+CommonConstants.ERROR_SHOW_TEXT, cause);
		return null;
	}

	@Override
	public ResponseResult save(JobInfoVo jobInfoVo) {
		log.error("创建定时任务失败，"+CommonConstants.ERROR_SHOW_TEXT, cause);
		return null;
	}

	@Override
	public ResponseResult updateById(XxlJobInfo xxlJobInfo) {
		log.error("更新定时任务失败，"+CommonConstants.ERROR_SHOW_TEXT, cause);
		return null;
	}

	@Override
	public ResponseResult removeById(Integer id) {
		log.error("删除定时任务失败，"+CommonConstants.ERROR_SHOW_TEXT, cause);
		return null;
	}
}
